<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:ace="http://www.icefaces.org/icefaces/components"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
  xmlns:icecore="http://www.icefaces.org/icefaces/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    
     
	<ui:composition template="../WEB-INF/templates/template.xhtml">
	
		<ui:param name="title" value="Fact Entry System" />
        	
		<ui:define name="header">
			<ui:include src="../WEB-INF/templates/header.xhtml" /> 
		</ui:define>
		
		<ui:define name="menu">		
			<ui:include src="../WEB-INF/templates/menuLeft.xhtml" />               
		</ui:define>
		
		<ui:define name="content">
		<icecore:singleSubmit submitOnBlur="false" /> 
		
	      	<style type="text/css">
                /* Important required because row */
                
                .ui-datatable-odd {background-color:lightgray !important;}
                table{width: 100%;}
                .columnAlignCenter{ 
						text-align: center !important; 

				}
				.columnAlignLeft{ 
						text-align: left !important; 
						padding-left: 10px;

				}
				
				
            </style>
                  
  			
  			<h:messages globalOnly="true" style="color: red;" />	            
            <ice:panelGroup style="height: 30px;margin-top: 20px;float:right;" rendered="false">
                 	<h:commandButton id="loginButton"  action="#{factBean.saveFacts}" actionListener="#{factBean.submit}"  value="Save" style="width:100px;height:30px;" />
            </ice:panelGroup>
            
             
            <c:forEach var="fact" items="#{factBean.factData}">
			  <c:if test="${fact.nodeType eq 3}">
			   	
			   		<h:panelGrid id="commandButtons" styleClass="headerPanel" columns="4" cellspacing="3" columnClasses="col1_leftAlign,col2,col3,col4">
                
            			<h:outputText value="${fact.factName}"/> 
        
						<c:forEach var="scenario" items="#{factBean.scenarioList}">
							<h:outputText value="${scenario.scenarioName}"/>
							</c:forEach>
					</h:panelGrid>   	 
			  </c:if>
			  
			  <c:if test="${fact.nodeType eq 5}">
			   	
			   		<h:panelGrid id="commandButtons" styleClass="dataPanel" columns="4" cellspacing="4" columnClasses="co1_rightAlign,col2,col3,col4">
                
            			<h:outputText value="${fact.factName}" /> 
        
						<c:forEach var="scenario" items="#{factBean.scenarioList}">
						
						   <c:if test="${scenario.scenarioId eq 1}">
						    <h:inputText value="#{fact.scenario1Value}" styleClass="textField"/>
						   </c:if>
						   
							<c:if test="${scenario.scenarioId eq 2}">
						    <h:inputText value="#{fact.scenario2Value}" styleClass="textField"/>
						   </c:if>
						   <c:if test="${scenario.scenarioId eq 3}">
						    <h:inputText value="#{fact.scenario3Value}" styleClass="textField"/>
						   </c:if>
						   
						</c:forEach>
					</h:panelGrid>   	 
			  </c:if>
			  
			  <c:if test="${fact.nodeType != 3}">
			    <c:if test="${fact.nodeType != 5}">
			   	
			   		<h:panelGrid id="commandButtons" styleClass="dataPanel" columns="4" cellspacing="4" columnClasses="col1_leftAlign">
                
            			<h:outputLabel value="${fact.factName}" style="padding-left: ${fact.labelPadding}px;"/> 
        
					
					</h:panelGrid>   	 
			  </c:if>
			  </c:if>
			  
			  
			</c:forEach>

            
         
					  
           
 
     
         </ui:define>
		
		<ui:define name="footer">
	       <ui:include src="../WEB-INF/templates/footer.xhtml" /> 
		</ui:define>
		
	</ui:composition>
	
</html>